package com.goldenKey.common.pojo.enumeration;

/**
 * 异常枚举类定义业务中已知的异常
 */

public enum ExceptionEnum {
    CODE_ERROR(401, "验证码错误"),
    USERNAME_NOT_EXISTS(402, "用户名不存在"),
    EMAIL_ALREADY_EXISTS(403, "邮箱已存在"),
    NICKNAME_ALREADY_EXISTS(404, "昵称已存在"),
    ACCOUNT_OR_PASSWORD_ERROR(405, "账号或密码错误"),
    ACCOUNT_DISABLE(406, "账号已禁用"),
    CATEGORY_NAME_ALREADY_EXISTS(408, "分类名称已存在"),
    PASSWORD_INCONSISTENCY(409, "密码不一致" ),
    LOGIN_EXPIRED(450, "登陆已过期，请重新登录"),
    CODE_EXPIRED(410, "验证码已过期");


    private int code;
    private String msg;

    ExceptionEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }
    public String getMsg() {
        return this.msg;
    }

}
